package demo529;

import java.util.HashMap;
import java.util.Map;
import java.util.Scanner;

public class TestMap {
    public static void main(String[] args) {
    Map<Integer,String> map = new HashMap<>();
    map.put(1,"张三");
    map.put(2,"李四");
    map.put(3,"王五");

    System.out.println(map.get("1"));

        Scanner  sc = new Scanner(System.in);
        for (Integer key:map.keySet()){
            if (key==sc.nextInt()){
            System.out.println(key+"-->"+map.get(key));
            }
        }

    System.out.println(map);
    map.put(1,"王五");
    System.out.println(map);


    }
}